<template>
   
  <div>
    <div>
      <el-button type="primary" size="small" @click="oppen.off = true"
        >添加</el-button
      >
      <el-button type="warning" size="small">批量删除</el-button>
    </div>

    <grid :lists="lists" :oppen="oppen" @remove="del"></grid>
    <pop-up :lists="lists" :oppen="oppen"></pop-up>
  </div>
</template>

<script>
import grid from "../category/seed.vue/grid.vue";
import popUp from "../category/seed.vue/popup.vue";
export default {
  data() {
    return {
      lists: [],
      oppen: {
        off: false,
      },
    };
  },
  methods: {
    //删除
    del(row) {
      this.$api.goodsDel({ id: row.id }).then((res) => {
        console.log(res);
        this.$message({
          message: "删除成功",
          type: "success",
        });
      });
    },
    //数据
    fn() {
      this.$api.goodsuser({ istree: true }).then((res) => {
        // console.log(res);
        this.lists = res.data.list;
      });
    },
  },
  created() {
    this.fn();
  },
  mounted() {},
  components: {
    grid,
    popUp,
  },
  computed: {},
  watch: {},
};
</script>

<style lang='scss' scoped>
</style>
